from nltk.chat.util import Chat, reflections
from nltk import ne_chunk, pos_tag, word_tokenize
import nltk

pairs = [
    [
        r"Hi|Hey|Hello",
        ["Hello there!", "Hi!", "Hey!"]
    ],
    [
        r"What is your name?",
        ["I am a chatbot.", "Call me Bot."]
    ]
]


def chatbot():
    print("Type quit to exit")
    chat = Chat(pairs, reflections)
    chat.converse()


def chatbot_response():
    # sentence = "比尔·盖茨是微软公司的创始人之一。"
    # tokenized_sentence = word_tokenize(sentence)
    # tagged_sentence = pos_tag(tokenized_sentence)
    # ne_tree = ne_chunk(tagged_sentence)
    # print(ne_tree)
    nltk.download()

if __name__ == "__main__":
    chatbot_response()
